package com.hbnu.dao;

import com.hbnu.pojo.Door;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface DoorsDao {

    @Select("select * from tb_door")
    List<Door> getDoors();

    @Select("select * from tb_door where id=#{id}")
    Door getDoorById(int id);

    @Delete("delete from tb_door where id=#{id}")
    int deleteDoor(int id);

    @Insert("insert into tb_door(name,tel,addr) values(#{name},#{tel},#{addr})")
    int addDoor(Door door);

    @Update("update tb_door set name=#{name},tel=#{tel},addr=#{addr} where id=#{id}")
    int updateDoor(Door door);
}
